package cn.whdream.test.entity;

import org.mybatis.dynamic.sql.BasicColumn;
import org.mybatis.dynamic.sql.BindableColumn;
import org.mybatis.dynamic.sql.render.TableAliasCalculator;
import org.mybatis.dynamic.sql.select.function.AbstractFunction;

import java.util.ArrayList;
import java.util.List;

public class Not<T> extends AbstractFunction<T, Not<T>> {

    protected List<BasicColumn> subsequentColumns = new ArrayList<>();
    protected Not(BindableColumn<T> column) {
        super(column);
    }


    @Override
    protected Not<T> copy() {
        return new Not<>(column);
    }

    @Override
    public String renderWithTableAlias(TableAliasCalculator tableAliasCalculator) {
        return "NOT( "+column.renderWithTableAlias(tableAliasCalculator)+" )";
    }

    public static <T> Not<T> of(BindableColumn<T> column){
        return new Not<>(column);
    }



}
